import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/login",
      name: "login",
      component: () => import("../views/Login.vue"),
    },
    {
      path: "/home",
      name: "home",
      component: () => import("../views/Home.vue"),
      children: [
        {
          path: "",
          component: () => import("../views/Echart.vue"),
        },
        {
          path: "shou",
          component: () => import("../views/Home.vue")
        },
        {
          path: "user",
          component: () => import("../views/User.vue"),
        },
        {
          path: "worker",
          component: () => import("../views/Worker.vue"),
        },
        {
          path: "vendor",
          component: () => import("../views/Vendor.vue"),
        },
        {
          path: "market",
          component: () => import("../views/Marketing.vue"),
        },
        {
          path: "order",
          component: () => import("../views/Order.vue"),
        },{
          path: "my",
          component: () => import("../views/My.vue"),
        }
      ],
    },
    {
      path:"/",
      redirect:"/login"
    }
  ],
});

export default router;
